<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <?php include 'inc/head.php'; ?>
  <style>
    .model-list li {
      list-style-type: none;
      padding: 2vh 0;
    }

    p .badge:first-of-type {
      white-space: unset;
    }
  </style>
</head>

<body>
  <?php include 'inc/header.php'; ?>

  <div class="container text-center model-list">

    <?php
    echo '<p>
    <span class="badge bg-secondary">运行环境：' . $_SERVER['SERVER_SOFTWARE'] . '</span>
    <span class="badge bg-secondary">PHP版本：' . phpversion() . '</span>
    <span class="badge bg-secondary">MYSQL版本：' . $GLOBALS['db']->getOne("SELECT VERSION()") . '</span>
    <span class="badge bg-secondary">上传限制：' . ini_get('upload_max_filesize') . '</span>
    </p>';

    $chn = $GLOBALS['db']->getOne("SELECT COUNT(id) FROM channel");
    $dtl = $GLOBALS['db']->getOne("SELECT COUNT(id) FROM detail");
    $sld = count(file_get('json', 'slideshow'));
    $chip = $GLOBALS['db']->getOne("SELECT COUNT(id) FROM chip");
    $link = count(file_get('json', 'link'));
    $adm = $GLOBALS['db']->getOne("SELECT COUNT(id) FROM user WHERE u_isadmin=1");

    echo '<div class="row">';

    echo '<ul class="col-4"><li>站点频道<br><a href="' . M($this->s, 'channel', 'index') . '"><span class="badge bg-secondary">' . $chn . '</span></a></li><li>频道详情<br><a href="' . M($this->s, 'detail', 'index') . '"><span class="badge bg-secondary">' . $dtl . '</span></a></li></ul>';

    echo '<ul class="col-4"><li>幻灯片<br><a href="' . M($this->s, 'slideshow', 'index') . '"><span class="badge bg-secondary">' . $sld . '</span></a></li><li>代码碎片<br><a href="' . M($this->s, 'chip', 'index') . '"><span class="badge bg-secondary">' . $chip . '</span></a></li></ul>';

    echo '<ul class="col-4"><li>管理员<br><a href="' . M($this->s, 'admin', 'index') . '"><span class="badge bg-secondary">' . $adm . '</span></a></li><li>友情连接<br><a href="' . M($this->s, 'link', 'index') . '"><span class="badge bg-secondary">' . $link . '</span></a></li></ul>';

    echo '</div>';
    ?>

  </div>

  <?php include 'inc/footer.php'; ?>
</body>

</html>
